package pa3;

import java.rmi.RemoteException;

public class Main {
	public static void main(String args[]){
		try {
			Thread systemManager = new Thread(new SystemManagerImpl());
			systemManager.start();
			Thread.sleep(5000);
			
			//create 4 hosts with zero failure rate
			new Thread(new HostImpl("host1", 0)).start();
			Thread.sleep(1000);
			new Thread(new HostImpl("host2", 0)).start();
			Thread.sleep(400);
			//create 4 hosts with 50% failure rate
			new Thread(new HostImpl("host5", 0)).start();
			Thread.sleep(2000);
			new Thread(new HostImpl("host6", 0)).start();
			Thread.sleep(2500);
			new Thread(new HostImpl("host7", 0)).start();
			Thread.sleep(3000);
			new Thread(new HostImpl("host8", 0)).start();
			Thread.sleep(1000);
			new Thread(new HostImpl("host3", 0)).start();
			Thread.sleep(900);
			new Thread(new HostImpl("host4", 0)).start();
			
			
			
		} catch (RemoteException e) {
			e.printStackTrace();
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
